<script setup>
import { ref } from 'vue'

const data = ref(null)

fetch('http://localhost:3000/api/data')
  .then(res => res.json())
  .then(res => data.value = res)
</script>

<template>
  <h1>{{ data?.message }}</h1>
</template>